# -*- coding: utf-8 -*-
# @Time    : 2022/5/25 20:20
# @Author  : zhangping
# @Email   : 2432115515@qq.com
# @File    : page_register.py
# @Software: PyCharm 
"""
注册页面
"""
from selenium.webdriver.common.by import By

from page.base_page import BasePage


class RegisterPage(BasePage):
    #用户名输入框定位器
    ele_username_locator = (By.ID, "username")
    # 邮件输入框定位器
    ele_email_locator = (By.ID, "email")
    # 密码输入框定位器
    ele_password1_locator = (By.ID, "password1")
    # 确认密码输入框定位器
    ele_conform_password_locator = (By.ID, "conform_password")
    # 注册按钮定位器
    ele_register_btn_locator = (By.NAME, "Submit")

    def ele_username(self):
        """输入用户名"""
        self.driver.find_element(*self.ele_username_locator).send_keys("zhangz")
    def ele_email(self):
        """输入邮件"""
        self.driver.find_element(*self.ele_email_locator).send_keys("4567825@qq.com")
    def ele_password1(self):
        """输入密码"""
        self.driver.find_element(*self.ele_password1_locator).send_keys("123456")
    def ele_conform_password(self):
        """输入确认密码"""
        self.driver.find_element(*self.ele_conform_password_locator).send_keys("123456")
    def ele_register_btn(self):
        """点击注册"""
        self.driver.find_element(*self.ele_register_btn_locator).click()
    def register(self):
        """聚合注册"""
        self.ele_username()
        self.ele_email()
        self.ele_password1()
        self.ele_conform_password()
        self.ele_register_btn()

